1. Field of the Invention
The present invention relates to a pattern detection apparatus, processing method thereof, and computer-readable storage medium.
2. Description of the Related Art
Assembling or packaging of products includes, for example, a process for storing components or products in small partitions (or slots) of a partitioned tray or a process for picking up components from there. These processes can be automated by image recognition using, for example, a visual sensor and manipulator. When the processes are automated by image recognition, template matching such as a normalized correlation method is executed using the shape of each partition or slot, which is registered in advance, thereby aligning the position of each individual partition. Then, a product is stored in that partition or it is picked up from that partition.
As a subject of image recognition associated with such process, for example, defect inspection for an object having a periodic structure (for example, a substrate component or display panel) is known. In image recognition in such defect inspection, a method of extracting one unit of patterns using the periodicity of the patterns, and comparing it with a reference image, and a method of detecting a defect by comparing extracted patterns with each other is used.
When a periodic component of repetitive patterns is unknown, a method of estimating a period based on a frequency component obtained by Fourier transformation or an autocorrelation function is adopted. A technique described in Japanese Patent Laid-Open No. 07-159344 estimates a period using an autocorrelation function. Then, using a plurality of peaks of the autocorrelation function, which are generated at intervals as integer multiples of a periodic component, repetitive patterns are compared with each other, thereby detecting a defect.
These methods are premised on that repetitive patterns of a target object such as a panel or tray are repeated at a constant period to some extent, and are not largely deviated from that period. In addition, these methods are also premised on that even when a structure which is not related to the repetitive patterns exists, its influence is negligibly small, and the number of repetitions of patterns is sufficiently larger than the number of disturbances.
However, in an actual manufacturing site, such premises are not often satisfied. For example, when manual operations for storing produced components in slots of a tray are replaced by a manipulator, the following disturbance factors often arise:
(1) since the tray is manually formed, the shapes and intervals of individual slots are not accurate;
(2) since the specification of, for example, a tray is not settled, the numbers and shapes of slots are different for respective trays;
(3) the sizes and number of slots are adjusted by screw clamping in correspondence with production adjustment;
(4) the tray is distorted due to aging, low assembling precision, and insufficient rigidity of materials;
(5) structures such as beams used to reinforce the tray, which are not related to the repetitive patterns, exist together; and
(6) the number of repetitions of patterns is insufficient for the non-related structures.
Hence, it becomes difficult to estimate the period of the repetitive patterns and to detect the pattern.
In order to exclude such disturbance factors, the tray may be replaced by a high-precision dedicated jig, which is managed using a barcode or RFID tag. In this case, however, high cost is required for storage and management. Also, the dedicated jig has poor flexibility for production adjustment or changes of specifications, and is not suited for low-volume, multiple production. For example, when products are stored in partitions of a cardboard box for packaging, it is not often practical to replace a storage box by another.
In addition, in order to eliminate, for example, distortion caused by aging, a high-rigidity tray (for example, made up of metal) is often used. However, when a component or manipulator contacts the tray during handling of the component, the component or manipulator readily suffers dents or failures.